Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/filter setcode tx #8167

Merged
merged 17 commits into from
Feb 12, 2025
Merged

Feature/filter setcode tx #8167

merged 17 commits into from
Feb 12, 2025

Conversation

ak88
Copy link
Contributor

@ak88 ak88 commented Feb 5, 2025

Changes for OnlyOneTxPerDelegatedAccountFilter to align with ethereum/go-ethereum#31073

Filter now also restricts SetCode tx that has any delegation authority with a pending tx.
"Only one tx for delegated account" rule, is simplified to only accept a tx from delegated account if the nonce matches current account state.

Things to note:

  • Pending tx are not removed immediately when an account is delegated.
  • Any pending delegation will restrict all tx from that authority, unless it has a self-sponsored SetCode pending.

@ak88 ak88 marked this pull request as ready for review February 10, 2025 11:43
Comment on lines 20 to 38
protected override IComparer<Transaction> GetGroupComparer(IComparer<Transaction> comparer)
{
throw new NotImplementedException();
}

protected override UInt256 GetKey(Transaction value)
{
throw new NotImplementedException();
}

protected override IComparer<Transaction> GetUniqueComparer(IComparer<Transaction> comparer)
{
throw new NotImplementedException();
}

protected override AddressAsKey MapToGroup(Transaction value)
{
throw new NotImplementedException();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ok to leave like that? Aren’t those required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought i had deleted this. Will remove it.

Copy link
Member

@LukaszRozmej LukaszRozmej Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is abstract, I thought those were kind of mandatory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the whole class. I had a more complex solution before, until I figured the current solution would be simpler. So this is no longer used at all.

src/Nethermind/Nethermind.TxPool/Collections/SortedPool.cs Outdated Show resolved Hide resolved
src/Nethermind/Nethermind.TxPool/TxPool.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@marcindsobczak marcindsobczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few minor nitpicks, mostly naming

src/Nethermind/Nethermind.TxPool/AcceptTxResult.cs Outdated Show resolved Hide resolved
src/Nethermind/Nethermind.TxPool/TxPool.cs Outdated Show resolved Hide resolved
src/Nethermind/Nethermind.TxPool/AcceptTxResult.cs Outdated Show resolved Hide resolved
@kamilchodola kamilchodola added this to the 1.31.0 milestone Feb 10, 2025
@kamilchodola kamilchodola merged commit 6c755fb into master Feb 12, 2025
79 checks passed
@kamilchodola kamilchodola deleted the feature/filter-setcode-tx branch February 12, 2025 12:14
kamilchodola pushed a commit that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants